<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<style>
    .noteMain {
        width: 100%;
        height: 330px;
        z-index: 1;
        background: #f3f2f3 url("${basePath}/resources/images/shmy/bg.jpg") 0 0;
        background-size: cover;

    }

    .noteLeft {
        width: 40%;
        height: 315px;
        text-align: center;
        color: #fff;
        padding-top: 7px;
        float: left;
    }

    .noteRight {
        width: 60%;
        height: 314px;
        float: left;
    }

    .noteRightMain {
        width: 100%;
        height: 292px;
        margin-top: 12px;
        border-left: 1px solid #94c9ff;
        overflow: hidden;
        position: relative;
    }

    .noteRightSub {
        width: 100%;
        height: 292px;
        position: absolute;
        left: 0;
        top: 0;
    }

    .noteRightMainTop, .noteRightMainBottom {
        width: 70%;
        height: 146px;
        margin-left: 5px;
    }

    .noteRightMainBottom {
        border-top: 1px solid #94c9ff;
    }

    .noteTite {
        position: relative;
        top: 59px;
        left: 0;
        font-size: 18px;
        font-weight: bold;
        color: white;
        text-align: left;
        text-indent: 100px;
    }

    .timePlace {
        position: relative;
        top: 51px;
        left: 0;
        color: white;
        text-align: left;
        text-indent: 100px;
    }

    .noteRightMainBottom .timePlace {
        position: relative;
        top: 38px;
        left: -52px;
        color: white;
    }

    .noteRightMainBottom .noteTite {
        position: relative;
        top: 44px;
        left: 16px;
        font-size: 18px;
        font-weight: bold;
        color: white;
    }

    /***日程样式***/
    #content_left .result-op, #content_left .result {
        border-collapse: collapse;
        margin-bottom: 14px;
    }

    table, img {
        border: 0 none;
    }

    .c-container table {
        border-collapse: collapse;
        border-spacing: 0;
    }

    .op-calendar-new-table td, .op-calendar-new-table th {
        height: 40.5px;
        padding: 0;
    }

    .op-calendar-new-table-festival .op-calendar-new-table-almanac, .op-calendar-new-table-weekend .op-calendar-new-daynumber, th.op-calendar-new-table-weekend {
        color: #e02d2d;
    }

    .c-container td {
        font-size: 8px;
        line-height: 1.54;
    }

    .op-calendar-new-table td, .op-calendar-new-table th {
        padding: 0;
    }

    .op-calendar-new-table-six td {
        height: 33.75px;
    }

    .op-calendar-new-table th {
        background: #e0e0e0;
        font-size: 12px;
        font-weight: 400;
        height: 24.75px;
    }

    .op-calendar-new-table td a {
        display: block;
        height: 35px;
        line-height: 1;
        overflow: hidden;
        text-align: center;
        text-decoration: none;
        white-space: nowrap;
        width: 100%;
    }

    .op-calendar-new-table td a * {
        cursor: pointer;
    }

    .op-calendar-new-table-other-month .op-calendar-new-daynumber, .op-calendar-new-table-other-month .op-calendar-new-table-almanac {
        color: #bfbfbf;
    }

    .op-calendar-new-table td .op-calendar-new-table-border, .op-calendar-new-table td .op-calendar-new-table-selected, .op-calendar-new-table td a:hover {
        width: 100%;
        background: #fb0;
    }

    .op-calendar-new-table-today .op-calendar-new-daynumber, .op-calendar-new-table-today .op-calendar-new-table-almanac {
        color: #fff;
    }

    .op-calendar-new-table td .op-calendar-new-table-rest, .op-calendar-new-table td .op-calendar-new-table-work {
        background: #fff0f0 none repeat scroll 0 0;
    }

    .op-calendar-new-table-other-month .op-calendar-new-table-holiday-sign {
        opacity: 0.5;
    }

    .op-calendar-new-right-date {
        height: 48px;
        line-height: 48px;
    }

    .op-calendar-new-right-day {
        background: #fb0 none repeat scroll 0 0;
        border-radius: 3px;
        box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.1), -1px 2px 5px rgba(0, 0, 0, 0.1);
        font-size: 52px;
        height: 75px;
        line-height: 76px;
        margin: 0 auto;
        position: relative;
        width: 75px;
    }

    .op-calendar-new-right-lunar span {
        display: block;
    }

    .op-calendar-new-right-almanac span {
        display: block;
        float: left;
        overflow: hidden;
        white-space: nowrap;
        width: 100%;
    }

    .op-calendar-new-right-almanac i {
        display: block;
        height: 30px;
        margin: 0 auto 5px;
        width: 22.5px;
    }

    .op-calendar-hover-avoid i, .op-calendar-hover-suit i, .op-calendar-new-right-almanac i {
        color: #fff;
        font: 18px/22px "Microsoft Yahei";
        text-align: center;
        text-shadow: 2px 2px 1px rgba(0, 0, 0, 0.1);
    }

    .op-calendar-new-right-almanac span {
        display: block;
        float: left;
        overflow: hidden;
        white-space: nowrap;
        width: 100%;
    }

    /****左右按钮***/
    .carousel-control {
        /*background: #222 none repeat scroll 0 0;*/
        border: 2px solid #fff;
        border-radius: 23px;
        color: #fff;
        font-size: 60px;
        font-weight: 100;
        height: 40px;
        left: 15px;
        line-height: 30px;
        margin-top: -20px;
        opacity: 0.5;
        position: absolute;
        text-align: center;
        top: 50%;
        width: 40px;
        text-decoration: none;
    }

    .carousel-control:hover, .carousel-control:focus {
        color: #fff;
        opacity: 0.9;
        text-decoration: none;

    }

    .carousel-control.right {
        left: auto;
        right: 15px;
    }

</style>

<div class="noteMain">
    <div class="noteLeft c-clearfix">
        <p class="op-calendar-new-right-date"></p>

        <p class="op-calendar-new-right-day">9</p>
        <!--<p class="op-calendar-new-right-lunar c-gap-top-small"><span>六月廿五</span></p>-->

        <iframe allowtransparency="true" frameborder="0" width="140" height="128" scrolling="no"
                src="http://tianqi.2345.com/plugin/widget/index.htm?s=1&z=1&t=1&v=1&d=1&bd=0&k=&f=ffffff&q=1&e=0&a=1&c=58238&w=140&h=128&align=center"></iframe>


    </div>
    <div class="noteRight">
        <div class="noteRightMain">
            <div class="noteRightSub">
                <c:forEach items="${rcap}" var="item" varStatus="status">
                    <div class="noteRightMainTop"
                         <c:if test="${status.index%2==1}">style="border-top: 1px solid #94c9ff"</c:if> >
                        <div class="timePlace">
                            <span style="font-weight:bold;font-size: 15px;" sss="${item.begintime}">${item.begintime}:00</span>
                            <span style="font-size: 13px">${item.location}</span>
                        </div>
                        <div class="noteTite">${item.title}</div>
                    </div>
                </c:forEach>
            </div>
        </div>
        <a data-slide="prev" href="javascript:;" class="left carousel-control">‹</a>
        <a data-slide="next" href="javascript:;" class="right carousel-control">›</a>
    </div>

</div>

<script>
    var currentPage = 1;        //当前页码

    $(function () {
        //显示日期
        $(".op-calendar-new-right-date").html(getDate() + " " + week());
        //显示多少号
        $(".op-calendar-new-right-day").html(new Date().getDate());

        getTodayNotes();

        $("a[data-slide]").click(function () {
            var top = parseInt($(".noteRightSub").css("top").replace("px", "").replace("%", ""), 10);
            var sum = $(".noteRightMainTop").length % 2 == 0 ? (( $(".noteRightMainTop").length / 2 - 1 ) * 292) : (( $(".noteRightMainTop").length - 1) / 2 * 292);
            if ($(this).is(".left") && top != 0) {
                $(".noteRightSub").css("top", (top + 292) + "px");
            } else if ($(this).is(".right") && (top + sum) != 0) {
                $(".noteRightSub").css("top", (top - 292) + "px");
            }
        });

        if($(".noteRightSub .noteRightMainTop").length == 0){
            $(".noteRightSub").html('<div class="noteRightMainTop" style="width:90%;height:292px;line-height:292px;"><div class="noteTite" style="text-indent:0;text-align:center;top:0;">今日无日程，请点击设置日程！</div></div>');
        }

        $("span[sss]").html(function(){
            var s = parseInt($(this).attr("sss"),10);
            return s%2==0?(s/2+":00"):((s-1)/2+":30");
        })
    });

    //获取日期
    function getDate() {
        var now = new Date();
        var year = now.getFullYear();       //年
        var month = now.getMonth() + 1;     //月
        var day = now.getDate();            //日
        var clock = year + "-";
        /*if (month < 10)
         clock += "0";*/
        clock += month + "-";
        /*if (day < 10)
         clock += "0";*/
        clock += day;
        return (clock);
    }

    //获取星期几
    function week() {
        var myDate = new Date();
        ;
        var Week = ['日', '一', '二', '三', '四', '五', '六'];
        var str = '星期' + Week[myDate.getDay()];
        return str;
    }


    //获取今天的通知,后期从后台取真实数据
    function getTodayNotes() {
        var jsonObj = [
            {
                time: '9:30',
                place: '教学1号楼',
                note: '一周会议'
            },
            {
                time: '10:30',
                place: '图书馆2楼会议室',
                note: '2015迎新安排会议'
            },
            {
                time: '13:30',
                place: '教学3号楼',
                note: 'C语言设计课'
            }, {
                time: '15:30',
                place: '教学2号楼',
                note: 'JAVA语言设计课'
            }
        ];
        return jsonObj;
    }

    //设置提示html代码
    function setNoteHtml() {

    }
</script>